<?php /* Smarty version 2.6.18, created on 2009-11-19 00:23:13
         compiled from mail.tpl */ ?>
<script type="text/javascript">	
	var calendar1 = new ekimo_calendar("f_show","f_date","From Date", "fdatecontainer");
	var calendar2 = new ekimo_calendar("t_show","t_date","To Date", "tdatecontainer");
</script>
<div id="main_content" width="100%">
<form name="mainForm" method="POST" action="/admin/mailSaveListChanges">
<div id="blanket" style="display:none;"></div>
	<div width="100%">
		<h1>Messaging Inbox</h1>
	</div>
	<br>
	
	<div width="100%" class="blue">
		<table width="100%">
			<tr>
				<td>Sender:</td>
				<td>
					<select name="sender" id="sender">
					<option value=""> --- </option>
					<?php $_from = $this->_tpl_vars['senders']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['sender']):
?>
						<option value="<?php echo $this->_tpl_vars['sender']['id']; ?>
"> 
							<?php echo $this->_tpl_vars['sender']['name']; ?>

						</option>
					<?php endforeach; endif; unset($_from); ?>
					</select>
				</td>
			</tr>
			<tr>
				<td>Date From:</td>
				<td>
					<label for="f_date" class="yui-skin-sam">
						<input type="text" name="f_date" id="f_date">
						<a href="javascript:void(0);" id="f_show">
							<img alt="Calendar" src="/app/default/www/images/calendar.jpg" border="0"/>
						</a>
						<div id="fdatecontainer" style="display:none;position:absolute"></div> 
					</label>
				</td>
			</tr>
			<tr >
				<td>Date To:</td>
				<td>
					<label for="t_date" class="yui-skin-sam">
						<input type="text" name="t_date" id="t_date">
						<a href="javascript:void(0);" id="t_show">
							<img alt="Calendar" src="/app/default/www/images/calendar.jpg" border="0"/>
						</a>
						<div id="tdatecontainer" style="display:none;position:absolute"></div> 
					</label>
				<input type="button" value="Search" onclick="search();"></td>
			</tr>
		</table>
	</div>
	<br>
	
	<div id="data_table" width="100%">
		<div id="pageNavPosition" style="color:#84b5cc"></div>
		<table width="100%" id="results">
			<tr bgcolor="#cccccc">
				<td width="5%"><b>Delete</b></td>
				<td width="10%"><b>Date</b></td>
				<td><b>Sender</b></td>
				<td><b>Subject</b></td>
				<td></td>
			</tr>
			<?php $_from = $this->_tpl_vars['msgs']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['msg']):
?>
				<tr <?php if ($this->_tpl_vars['msg']['read']): ?> bgcolor="#f0f0f0"<?php endif; ?>>
					<td><input type="checkbox" name="del_<?php echo $this->_tpl_vars['msg']['message_id']; ?>
" value="1"></td>
					<td><?php echo $this->_tpl_vars['msg']['date_sent']; ?>
</td>
					<td><?php echo $this->_tpl_vars['msg']['source']; ?>
</td>
					<td><?php echo $this->_tpl_vars['msg']['subject']; ?>
</td>
					<td><input type="button" value="Read" onclick="edit_item(<?php echo $this->_tpl_vars['msg']['message_id']; ?>
);"</td>
				</tr>
			<?php endforeach; endif; unset($_from); ?>
		</table>
		<br><hr>
	</div>
	<input type="button" value="Save to Excel">
	<input type="button" value="New Message" onclick="edit_item(0)">
	<input type="submit" value="Delete">
	</form>
</div>
<div id="popUpDiv" style="position:absolute;display:none;z-index:1002;width:400px;">
	<table class="popup" border="0" cellspacing=0 cellpadding=0>
		<tr>
			<td>
				<div class="pop">
					<div class="top_pop"><img src="/app/default/www/images/top_left_pop.jpg" /></div> 
						<div id="edit_content" class="content">
						</div>
					<div class="btm_pop"><img src="/app/default/www/images/btm_left_pop.jpg"  alt="" />				</div>
				</div>
			</td>
		</tr>
	</table> 
</div>
<?php echo '
<script language="javascript">
	ekimo_drag_region("","popUpDiv");
	function edit_item(id){
		doajaxAction(\'/admin/mailEdit/id/\'+id,0,\'edit_content\');
		popup(\'popUpDiv\');
	}
	function search(){
		var sender=document.getElementById("sender");
		var f_date=document.getElementById("f_date");
		var t_date=document.getElementById("t_date");
		doajaxAction(\'/admin/mailSearch/sender/\'+sender.value+
					\'/f_date/\'+f_date.value+
					\'/t_date/\'+t_date.value,0,\'data_table\');
	}
	
	var pager = new Pager(\'results\', 10); 
	pager.init(); 
	pager.showPageNav(\'pager\', \'pageNavPosition\'); 
	pager.showPage(1);
</script>
'; ?>